﻿using System;
using System.Windows.Forms;

namespace Amgine
{
    public partial class ValidatePermissionForm : Form
    {
        public ValidatePermissionForm()
        {
            InitializeComponent();
        }

        private void button_confirm_Click(object sender, EventArgs e)
        {
            if (doValidate())
            {
                DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                MessageBox.Show("密码不正确", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private bool doValidate()
        {
            return Properties.Settings.Default.user_password.Equals(textBox_password.Text);
        }

        private void button_cancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void ValidatePermissionForm_Load(object sender, EventArgs e)
        {
            textBox_password.Focus();
        }
    }
}
